package com.gxy.learn.design.model.construction.decorator;

/**
 * @description: 培根类 具体的装饰者类
 * @author: gaoxueyong
 * @Date: 2022/11/7 19:28
 */
public class Bacon extends Garnish {
    public Bacon(FastFood fastFood) {
        super(fastFood, 2, "培根");
    }

    /**
     * 计算价格
     *
     * @return double
     * @Author gaoxueyong
     * @Date 7:21 下午 2022/11/7
     * @Param []
     **/
    @Override
    public double cost() {
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return String.format("%s 加 %s", getFastFood().getDesc(), super.getDesc());
    }
}
